function getTextCallback(doneChangingTextCallback) { // 获取文本标注
	var annotationDialog = $('.annotationDialog');
	var getTextInput = annotationDialog.find('.annotationTextInput');
	var confirm = annotationDialog.find('.annotationDialogConfirm');
	annotationDialog.get(0).showModal();
	confirm.off('click');
	confirm.on('click', function() {
		closeHandler();
	});
	annotationDialog.off("keydown");
	annotationDialog.on('keydown', keyPressHandler);

	function keyPressHandler(e) { // 关闭dialog
		if(e.which === 13) {
			closeHandler();
		}
	}

	function closeHandler() {
		annotationDialog.get(0).close();
		doneChangingTextCallback(getTextInput.val());
		getTextInput.val("");
	}
}

function changeTextCallback(data, eventData, doneChangingTextCallback) { // 输入文本
	var relabelDialog = $('.relabelDialog');
	var getTextInput = relabelDialog.find('.annotationTextInput');
	var confirm = relabelDialog.find('.relabelConfirm');
	var remove = relabelDialog.find('.relabelRemove');
	getTextInput.val(data.annotationText);
	relabelDialog.get(0).showModal();
	confirm.off('click');
	confirm.on('click', function() {
		relabelDialog.get(0).close();
		doneChangingTextCallback(data, getTextInput.val());
	});
	remove.off('click'); // 删除文本标注
	remove.on('click', function() {
		relabelDialog.get(0).close();
		doneChangingTextCallback(data, undefined, true);
	});
	relabelDialog.off("keydown");
	relabelDialog.on('keydown', keyPressHandler);

	function keyPressHandler(e) {
		if(e.which === 13) {
			closeHandler();
		}
	}

	function closeHandler() {
		relabelDialog.get(0).close();
		doneChangingTextCallback(data, getTextInput.val());
		getTextInput.val("");
	}
}